package org.springframework.context.support;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.support.XmlBeanDefinitionReader;
import org.springframework.beans.support.DefaultListableBeanFactory;

public abstract class AbstractXmlApplicationContext extends AbstractRefreshApplicationContext {

    @Override
    protected void loadBeanDefinitions(DefaultListableBeanFactory beanFactory) throws BeansException {
        XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(beanFactory, this);
        for (String location : getConfigLocation()) {
            reader.loadBeanDefinition(location);
        }
    }

    protected abstract String[] getConfigLocation();
}
